package edu.wpi.first.wpilibj.templates.commands;

import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.templates.OI;
//import edu.wpi.first.wpilibj.templates.subsystems.ExampleSubsystem;
import edu.wpi.first.wpilibj.templates.subsystems.Chassis;
import edu.wpi.first.wpilibj.templates.subsystems.Cam;

/**
 * The base for all commands. All atomic commands should subclass CommandBase.
 * CommandBase creates and stores each control system. To access a
 * subsystem elsewhere in your code use CommandBase.exampleSubsystem
 * @author Author
 */
public abstract class CommandBase extends Command {

    public static OI oi; // operator interface (ie. joysticks, etc.)
    
    /**
     * Create a single static instance of all subsystems
     * Right now we just have chassis
     */
    public static  Chassis chassis = new Chassis(); // create drive train subsytstem
    
    public static  Cam cam = new Cam(); // create CAM subsytstem

    /**
     * Initialization method which creates the operator interface and 
     * sends each subsystem's data to the smart dashboard if in use.
     * Note: We only have 1 subsystem- the drive train (chassis)
     */
    public static void init() {
        // This MUST be here. If the OI creates Commands (which it very likely
        // will), constructing it during the construction of CommandBase (from
        // which commands extend), subsystems are not guaranteed to be
        // yet. Thus, their requires() statements may grab null pointers. Bad
        // news. Don't move it.
        oi = new OI();

        // Send chassis data to dashboard
        SmartDashboard.putData(chassis);
    
        // send cam data to dashboard
        SmartDashboard.putData(cam);
    }

    public CommandBase(String name) {
        super(name);
    }

    public CommandBase() {
        super();
    }
}

